﻿using System;
using System.Collections.Generic;

using E.Enum;
using E.BLL;
using E.Model;
using E.Web.UI.Page;

using X.Common;

namespace E.Web.Teacher.exam
{
    public partial class ScoreInput3 : TeacherBasePage
    {
        public string act;
        public IList<DictAreaModel> areaList = new List<DictAreaModel>();
        public IDictionary<int, string> certificateList;
        public IDictionary<int, string> scoreCategoryList;
        public IList<ShortScoreInputModel> scoreList;

        public string loginid = "";
        public string userName = "";
        public int certificateid = -1;
        public int scoreCategoryid = -1;
        public int recordDisplayQuantity = -1;
        public int isInputed = -1;

        protected override void ShowPage()
        {
            areaList = GetTeacherAreaList(teacherid);
            act = XRequest.GetString("act");
            certificateList = GetCertificateList();
            //scoreCategoryList = EnumClass.GetInputScoreCategoryList();

            ExamBLL bll = new ExamBLL();
            scoreCategoryList = bll.GetInputScoreCategoryList();

            if (ispost || act == "s")
            {
                loginid = XRequest.GetString("LoginIDTxt");
                userName = XRequest.GetString("UserNameTxt");
                certificateid = XRequest.GetInt("CertificateSlt", -1);
                scoreCategoryid = XRequest.GetInt("ScoreSlt", -1);
                recordDisplayQuantity = XRequest.GetInt("DisplayQuantitySlt", -1);
                isInputed = XRequest.GetInt("IsInputedSlt", -1);

                if (areaList.Count == 1)
                {
                    areaid = areaList[0].ID;
                }
                else
                {
                    areaid = XRequest.GetInt("AreaSlt", -1);
                }

                SearchScoreInputModel searchModel = new SearchScoreInputModel();
                searchModel.LoginID = loginid;
                searchModel.UserName = userName;
                searchModel.CertificateID = certificateid;
                searchModel.ScoreCategoryID = scoreCategoryid;
                searchModel.RecordDisplayQuantity = recordDisplayQuantity;
                searchModel.IsInputed = isInputed;
                searchModel.AreaID = areaid;

                scoreList = bll.GetScoreInputList(searchModel);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
